Configure Python on macOS
Configure Python on macOS
This page will walk you through installing Python and setting up your environment on macOS.
Installing Python
macOS comes with a system Python, but it is outdated and should not be used for development. Install a fresh version using one of the following methods.
Option A: Homebrew (Recommended)
If you do not have Homebrew installed:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Then install Python:
brew install python
Option B: Official Installer
Download the macOS installer from python.org/downloads and follow the prompts.
Verify
python3 --version
On macOS, use
python3andpip3unless you have configured an alias or are inside a virtual environment.
Installing VS Code
- Download VS Code.
- Move it to your Applications folder.
- Open it and install the Python extension (Cmd+Shift+X → search Python → Install).
Creating the Course Folder
Open Terminal and run:
mkdir python-101
cd python-101
Setting Up a Virtual Environment
python3 -m venv .venv
source .venv/bin/activate
You should now see (.venv) in your terminal prompt.
You will need to run
source .venv/bin/activateeach time you open a new terminal. Grade 8 covers virtual environments in detail.
Verifying Your Setup
With your virtual environment active, run:
python --version
pip --version
Both should return version numbers. You are ready to start Grade 1.
Notes
- Once inside a virtual environment,
pythonandpiprefer to the environment's versions — no need to usepython3. - VS Code will detect your
.venvautomatically when you open the folder — select it as your interpreter if prompted.